package cn.facetoken.homer;

import android.app.Application;
import android.os.Build;
import android.util.Log;

import java.util.Arrays;

//@HiltAndroidApp(Application.class)
public class MainApplication extends Application { //Hilt_MainApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        Log.w(getClass().getSimpleName(), String.format("onCreate(): Supported ABIs = %s.", Arrays.toString(Build.SUPPORTED_ABIS)));
        Log.w(getClass().getSimpleName(), String.format("onCreate(): Version = %d, Release = %s, Code Name = %s.", Build.VERSION.SDK_INT, Build.VERSION.RELEASE, Build.VERSION.CODENAME));
        Log.w(getClass().getSimpleName(), String.format("onCreate(): Manufacturer = %s, Brand = %s, Model = %s, Product = %s, Device = %s, Serial = %s.", Build.MANUFACTURER, Build.BRAND, Build.MODEL, Build.PRODUCT, Build.DEVICE, "Serial" /*Build.getSerial()*/));
        initializeMainDatabase();
    }

    private static MainDatabase mainDatabase;

    private void initializeMainDatabase() {
        new Thread(() -> mainDatabase = MainDatabase.getInstance(MainApplication.this)).start();
    }

    public static MainDatabase getMainDatabase() {
        return mainDatabase;
    }

}
